﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
//using DotNetOpenAuth.OpenId;
//using DotNetOpenAuth.OpenId.Extensions.SimpleRegistration;
//using DotNetOpenAuth.OpenId.RelyingParty;
//using DotNetOpenAuth.Messaging;

namespace QAS.Nekorama.Controllers
{
    public class AuthenticationController : Controller
    {
        //
        // GET: /Authentication/

        //    public ActionResult Login()
        //    {
        //        var openid = new OpenIdRelyingParty();
        //        IAuthenticationResponse response = openid.GetResponse();

        //        if (response != null)
        //        {
        //            switch (response.Status)
        //            {
        //                case AuthenticationStatus.Authenticated:
        //                    FormsAuthentication.RedirectFromLoginPage(
        //                        response.ClaimedIdentifier, false);
        //                    break;
        //                case AuthenticationStatus.Canceled:
        //                    ModelState.AddModelError("loginIdentifier",
        //                        "Login was cancelled at the provider");
        //                    break;
        //                case AuthenticationStatus.Failed:
        //                    ModelState.AddModelError("loginIdentifier",
        //                        "Login failed using the provided OpenID identifier");
        //                    break;
        //            }
        //        }

        //        return View();
        //    }

        //    [System.Web.Mvc.AcceptVerbs(HttpVerbs.Post)]
        //    public ActionResult LogOn(string loginIdentifier)
        //    {
        //        if (!Identifier.IsValid(loginIdentifier))
        //        {
        //            ModelState.AddModelError("loginIdentifier",
        //                        "The specified login identifier is invalid");
        //            return View();
        //        }
        //        else
        //        {
        //            var openid = new OpenIdRelyingParty();
        //            IAuthenticationRequest request = openid.CreateRequest(
        //                Identifier.Parse(loginIdentifier));

        //            // Require some additional data
        //            request.AddExtension(new ClaimsRequest
        //            {
        //                BirthDate = DemandLevel.NoRequest,
        //                Email = DemandLevel.Require,
        //                FullName = DemandLevel.Require
        //            });

        //            return request.RedirectingResponse.AsActionResult();
        //        }
        //    }

        //}
    }
}
